/*using System;
using System.Collections.Generic;
using System.Text;

using System.IO;

using System.Drawing;
using System.Drawing.Drawing2D;
using System.ComponentModel;
using VisualEditor.Parts;

namespace VisualEditor.Objects
{
    [Serializable()]
    public class LinkGlyph : SpeciesGlyph
    {
        public override object Clone()
        {
            LinkGlyph oResult = new LinkGlyph();
            oResult._Location = _Location;
            oResult._Dimensions = _Dimensions;
            oResult.Label = Label;
            oResult.LabelBounds = LabelBounds;
            oResult.LabelColor = LabelColor;
            oResult.LabelFont = LabelFont;

            oResult.ItemPtr = (Item)ItemPtr.Clone();
            oResult.Type = Type;

            //oResult._OutputConnections = _OutputConnections;
            //oResult._InputConnections = _InputConnections;

            oResult.EdgeColor = EdgeColor;
            oResult.EdgeThickness = EdgeThickness;
            oResult.Color = Color;
            return oResult;
        }
        protected PartGlyph _PartPtr;

        public PartGlyph PartPtr
        {
            get
            {
                return _PartPtr;
            }
            set
            {
                _PartPtr = value;
                /*if (_PartPtr.ItemPtr is Part && ItemPtr != null)
                {
                    ((Link)ItemPtr).PartPtr = (Part)_PartPtr.ItemPtr;
                }*
            }
        }

        public Link.LinkType _LinkType;

        public virtual Link.LinkType LinkType
        {
            get { return _LinkType; }
            set { _LinkType = value; }
        }

        public LinkGlyph(PointF location, Link.LinkType type, int num)
        {
            _Location = location;
            _Dimensions = new SizeF(10, 10);
            Label = "link" + num;
            _oFillColor = Color.DarkOrange;
            _oEdgeColor = Color.Red;

            ItemPtr = new Species();
            LinkType = type;
            //ItemPtr.Drawable = this;
        }

        public LinkGlyph()
        {
            _Location = new PointF(0, 0);
            _Dimensions = new SizeF(10, 10);
            Label = "Box_" + Program.Model.Drawables.Count;
            _oFillColor = Color.DarkOrange;
            _oEdgeColor = Color.Red;
            ItemPtr = new Species();
        }

        #region rendering

        public override bool HasPreview
        {
            get { return false; }
        }

        public override Bitmap GetPreview(int width, int height)
        {
            throw new Exception("The LinkGlyph is not intended to be inserted. Thus no preview is provided.");
        }

        private GraphicsPath ArrowUp()
        {
            RectangleF rect = Bounds;
            GraphicsPath oPath = new GraphicsPath();
            oPath.AddLine(new PointF(rect.Left + rect.Width / 2, rect.Top), new PointF(rect.Left, rect.Bottom));
            oPath.AddLine(new PointF(rect.Left, rect.Bottom), new PointF(rect.Right, rect.Bottom));
            oPath.AddLine(new PointF(rect.Right, rect.Bottom), new PointF(rect.Left + rect.Width / 2, rect.Top));
            return oPath;
        }
        private GraphicsPath ArrowDown()
        {
            RectangleF rect = Bounds;
            GraphicsPath oPath = new GraphicsPath();
            oPath.AddLine(new PointF(rect.Left + rect.Width / 2, rect.Bottom), new PointF(rect.Left, rect.Top));
            oPath.AddLine(new PointF(rect.Left, rect.Top), new PointF(rect.Right, rect.Top));
            oPath.AddLine(new PointF(rect.Right, rect.Top), new PointF(rect.Left + rect.Width / 2, rect.Bottom));
            return oPath;
        }
        private GraphicsPath ArrowLeft()
        {
            RectangleF rect = Bounds;
            GraphicsPath oPath = new GraphicsPath();
            oPath.AddLine(new PointF(rect.Left, rect.Top + rect.Height / 2), new PointF(rect.Right, rect.Top));
            oPath.AddLine(new PointF(rect.Right, rect.Top), new PointF(rect.Right, rect.Bottom));
            oPath.AddLine(new PointF(rect.Right, rect.Bottom), new PointF(rect.Left, rect.Top + rect.Height / 2));
            return oPath;
        }
        private GraphicsPath ArrowRight()
        {
            RectangleF rect = Bounds;
            GraphicsPath oPath = new GraphicsPath();
            oPath.AddLine(new PointF(rect.Right, rect.Top + rect.Height / 2), new PointF(rect.Left, rect.Top));
            oPath.AddLine(new PointF(rect.Left, rect.Top), new PointF(rect.Left, rect.Bottom));
            oPath.AddLine(new PointF(rect.Left, rect.Bottom), new PointF(rect.Right, rect.Top + rect.Height / 2));
            return oPath;
        }
        
        public override void RenderGlyph(Graphics g)
        {
            if (LinkType == Link.LinkType.both)
            {
                base.RenderGlyph(g);
                return;
            }

            SolidBrush linkColor = new SolidBrush(_oFillColor);
            RectangleF partBounds = PartPtr.Bounds;

            if (LinkType == Link.LinkType.input)
            {
                if (Bounds.Right == partBounds.Left)
                {
                    g.FillPath(linkColor, ArrowRight());
                }
                else
                    if (Bounds.Bottom == partBounds.Top)
                    {
                        g.FillPath(linkColor, ArrowDown());
                    }
                    else
                        if (Bounds.Left == partBounds.Right)
                        {
                            g.FillPath(linkColor, ArrowLeft());
                        }
                        else
                            if (Bounds.Top == partBounds.Bottom)
                            {
                                g.FillPath(linkColor, ArrowUp());
                            }
            }
            else
            {
                if (Bounds.Right == partBounds.Left)
                {
                    g.FillPath(linkColor, ArrowLeft());
                }
                else
                    if (Bounds.Bottom == partBounds.Top)
                    {
                        g.FillPath(linkColor, ArrowUp());
                    }
                    else
                        if (Bounds.Left == partBounds.Right)
                        {
                            g.FillPath(linkColor, ArrowRight());
                        }
                        else
                            if (Bounds.Top == partBounds.Bottom)
                            {
                                g.FillPath(linkColor, ArrowDown());
                            }
            }
        }
        
        #endregion

        public override PointF Location
        {
            get
            {
                return _Location;
            }
            set   //The Part controls the location of all its links
            {
                if (PartPtr != null)
                {
                    RectangleF rect = PartPtr.Bounds;
                    rect.X -= _Dimensions.Width;
                    rect.Y -= _Dimensions.Height;
                    rect.Width += _Dimensions.Width;
                    rect.Height += _Dimensions.Height;
                    _Location = Connector.GetPointOnEdge(rect, value, 0);
                }
            }
        }

        public override SizeF Dimensions
        {
            get
            {
                return _Dimensions;
            }
            set   //The Part controls the dimension of all its links
            {
            }
        }

    }
}
*/